home *** CD-ROM | disk | FTP | other *** search
/ Atari Mega Archive 2 / Atari Mega Archive CD - Volume 2.iso / 8bit / cislib_b / nocaps.doc < prev    next >
Text File  |  1995-04-22  |  5KB  |  223 lines

  1.  One thing that drives me CRAZY about
  2. Atari Basic is the fact that you can
  3. only type code in UPPER CASE. Does
  4. this sound familiar? You're typing
  5. along and run across something like:
  6.  
  7.  70 ?"Press any key"
  8.  
  9.  So you shift to lower case to type
  10. the string. But if you're as lazy as
  11. I am, chances are that when you get
  12. to the next line, you type something
  13. like:
  14.  
  15.  80 get #1,a
  16.  
  17.  WHOOPS -ERROR!! GO BACK AND RETYPE
  18. THE LINE...
  19.  
  20.  
  21.  Now MAC/65 doesn't mind, right? Why
  22. not see if we can get Atari Basic to
  23. be as forgiving?
  24.  
  25.  
  26.           GETTING STARTED
  27.  
  28.  
  29.  To install NoCaps, run the Basic
  30. program. The machine language will be
  31. installed on *groan* Page Six. Before
  32. you panic totally, I've posted the
  33. Source Code in this DL (NOCAPS.M65),
  34. so MAC/65 users can at least
  35. re-assemble it to another location if
  36. desired. Meanwhile...
  37.  
  38.  
  39.             WHAT IT DOES
  40.  
  41.  
  42.  NoCaps is activated by a USR(1536)
  43. NOCAPS.BAS does this automatically.
  44. It also POKES the memory location
  45. that puts the keyboard into lower
  46. case. When you've RUN the program,
  47. issue a list command. Look at that!
  48. Basic accepts it with no problem. Hit
  49. your 'inverse' key. Type list again.
  50. Hmm...it's in lower case AND inverse,
  51. but it STILL works! What's going on
  52. here???
  53.  
  54.  
  55.             HOW IT WORKS
  56.  
  57.  
  58.  To find out, type a new line of
  59. Basic with a line number in lower
  60. case:
  61.  
  62.  1000 dim a$(1)
  63.  
  64.  Now list 1000. Ah hah. Those
  65. lowercase letters you typed have been
  66. mysteriously transformed into UPPER
  67. CASE. THAT'S what NoCaps does. It
  68. intercepts the INPUT, and before
  69. Basic gets a chance to see it, tidies
  70. things up so everything is 'normal'.
  71. Technical notes at the end of this
  72. file...
  73.  
  74.  
  75.             LIMITATIONS
  76.  
  77.  
  78.  NoCaps treats just about everything
  79. you type the same way. It converts
  80. lower case to UPPER CASE, and strips
  81. inverse. There's just one exception:
  82. it leaves ANYTHING CONTAINED WITHIN
  83. QUOTES ALONE.
  84.  
  85.  That's good for typing PRINT
  86. commands.
  87.  
  88.  Not so good if you type something
  89. like save"d:program". In that case,
  90. DOS will try to do just that, and
  91. quickly return an error, since it
  92. doesn't know what a "d:" (as opposed
  93. to a "D:") IS. (Actually, there's a
  94. way around that, too. But that's
  95. another program...)
  96.  
  97.  Note: this ALSO means that REM
  98. statements are converted. Well,
  99. nobody's perfect...
  100.  
  101.  
  102.  
  103. **** NoCaps works <ONLY> in
  104. 'Immediate Mode'. It's a
  105. 'convenience' utility for typing in
  106. programs. If a program is RUNning, it
  107. leaves INPUT alone.
  108.  
  109.  
  110.  
  111.            SAFETY FIRST!
  112.  
  113.  
  114.  Anytime you use a program like this,
  115. there's a chance for disaster. If you
  116. have NoCaps active, and put something
  117. ELSE on Page Six, your computer will
  118. immediately Freeze Up the first time
  119. you try to type anything. (XE owners
  120. can usually recover from that with a
  121. RESET.)
  122.  
  123.  It will ALSO freeze if you try to
  124. execute the USR command while it's
  125. already activated. (careful with that
  126. one.)
  127.  
  128.  
  129.  The simplest way to disable NoCaps
  130. is just RESET. Or, you can type the
  131. BREAK key. Press it, and your
  132. computer reverts to it's normal mode,
  133. and you're safe.
  134.  
  135.  This isn't quite perfect. MOST of
  136. the time, if you hit BREAK to stop a
  137. program scroll, it'll have no effect.
  138. (FYI, The 'disable' routine sets the
  139. keyboard back to All Caps.) If you
  140. type BREAK to end a program, NoCaps
  141. WILL be disabled. 
  142.  To make absolutely sure you've got
  143. NoCaps disabled, YOU SHOULD PRESS THE
  144. BREAK KEY AT A 'READY' PROMPT. Or
  145. RESET.
  146.  
  147.  
  148.  Assuming you've left Page Six alone,
  149. you can turn NoCaps back on by
  150. calling the USR command again:
  151.  
  152.  ?USR(1536)
  153.  
  154.  That's it. Chances are, it's not
  155. something you can't live without, but
  156. when you need it...
  157.  
  158.  
  159.           TECHNICAL NOTES
  160.  
  161.  
  162.  To start, you need to know how the
  163. Atari handles it's I/O devices, which
  164. is beyond my scope here. See MAPPING
  165. THE ATARI pp. 81-82 (and 221-222 in
  166. the Revised version for XL/XE
  167. modifications) for info on that.
  168. Please note that by using the vector
  169. tables, it's relatively easy to write
  170. a program like this that works on
  171. both an 800 and an XE (there's a
  172. lesson there!)
  173.  
  174.  When you call the USR routine, a
  175. couple of things happen. The address
  176. of the E: handler table is changed
  177. from it's normal location in ROM, to
  178. Page Six. (The disable function works
  179. in reverse. The address of the E:
  180. handler is changed back to it's
  181. original value.) The ROM table is
  182. moved into the NEW table, then we
  183. make a change. Bytes 4 and 5 of any
  184. I/O table point to the GET BYTE
  185. routine. These are changed to point
  186. to the NoCaps code.
  187.  
  188.  Anytime you're typing on your Atari,
  189. each character is saved in the system
  190. buffer at LBUFF ($580). In the normal
  191. course of events, when you hit
  192. RETURN, Basic immediately takes over,
  193. and examines the contents of LBUFF,
  194. checking it for proper syntax. But
  195. we've put in a detour. Our NEW
  196. routine waits for a RETURN. When it
  197. gets one, it checks LBUFF first,
  198. doing the conversions noted above.
  199. Only after it's done, does Basic get
  200. to see the line. And by then, it's
  201. acceptable. Short and sweet.
  202.  
  203.  The only 'trick', is making NoCaps
  204. work in immediate mode, but not
  205. during a RUN. Fortunately, what with
  206. all the JSR's and stuff going on at
  207. any given moment in the OS, the value
  208. of the stack pointer is DIFFERENT in
  209. those two cases. NoCaps knows what
  210. the 'immediate mode' value is. So a
  211. CMP tells it which mode Basic is in.
  212.  
  213.  
  214.  As noted, the source code (crude as
  215. it is) can be found in NOCAPS.M65  As
  216. always, I hope you can improve it!
  217. Questions? Ask!!
  218.  
  219.  
  220.  
  221. >>don
  222.                                      
  223. DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD